Kameleon-Plus  0.3.2
Adapt3DInterpolator.h
Go to the documentation of this file.
1 /*
2  * Adapt3DInterpolator.h
3  *
4  * Created on: Oct 29, 2010
5  * Author: dberrios
6  */
7 
8 #ifndef ADAPT3DINTERPOLATOR_H_
9 #define ADAPT3DINTERPOLATOR_H_
10 
11 #include "Interpolator.h"
12 #include "Adapt3D.h"
13 
14 #define NNODE_ADAPT3D 4
15 #define NDIMN_ADAPT3D 3
16 #define DELAUNEY_SEARCH
17 
18 namespace ccmc
19 {
27  {
28  public:
30  float interpolate(const std::string&, const float& c0, const float& c1, const float& c2);
31  float interpolate(const std::string&, const float& c0, const float& c1, const float& c2, float& dc0,
32  float& dc1, float& dc2);
33  float interpolate(const long& variable_id, const float& c0, const float& c1, const float& c2);
34  float interpolate(const long& variable_id, const float& c0, const float& c1, const float& c2, float& dc0, float& dc1,
35  float& dc2);
36  static void calculation1(const float& a, const float& b, const float& c, const float& d, const float& e, float& result);
37  virtual ~Adapt3DInterpolator();
38 
39  private:
40  int nnode;
41 
42  /* variables needed for searching unstructured grids */
43 
44 // int numThreads;
45  SmartGridSearchValues *smartSearchValues;
46  //int unstructured_grid_setup_done;
47 
48  //bool setupUnstructuredGridSearchFinished;
49  //bool setupUnstructuredGridSearch();
50 
51 
52 
53  int ndimn, grid_reg_no, npoin, nelem;
54 
55  const std::vector<float> * coord;
56  const std::vector<int> * intmat;
57  float previous_c0;
58  float previous_c1;
59  float previous_c2;
60  int last_node_found;
61  int clear_cache;
62  //const std::vector<float> * unkno;
63 
64  /* support routines */
65 
66  int findElement(const float& c0, const float& c1, const float& c2, int clear_cache);
67  int chkineln(const float& c0, const float& c1, const float& c2, int ielem , float * shapex);
68 
69  int smartSearch(const float& c0, const float& c1, const float& c2);
70  int point_within_grid( const float * scoord );
71  int point_within_grid( const float& c0, const float& c1, const float& c2);
72  int index_2d_to_1d( int i1, int i2, int n2);
73  float interpolate_adapt3d_solution(const float& c0, const float& c1, const float& c2,int ielem, const std::string& variable);
74 
75  };
76 }
77 
78 #endif /* ADAPT3DINTERPOLATOR_H_ */